package com.shanzhe.eshop.common.nio;

import java.nio.ByteBuffer;

/**
 * @Author yinwei
 * @create 2021/12/24
 * @Version 1.0
 */
public class BufferDemo {

    public static void main(String[] args) throws Exception{

        byte[]data = new byte[]{0,1,2,3,4};
        ByteBuffer buffer = ByteBuffer.wrap(data);

        System.out.println(buffer.capacity());
        System.out.println(buffer.position());
        System.out.println(buffer.limit());
        System.out.println(buffer.mark());
        System.out.println(buffer.get());
        System.out.println(buffer.position());
        System.out.println(buffer.limit());
    }
}
